package com.jmxcfc.blfsc.common.sms;

import com.jmxcfc.blfsc.common.validation.rule.RequestFieldRule;
import lombok.Data;
import org.apache.http.client.methods.HttpRequestBase;
import org.springframework.http.HttpEntity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 上下文
 * @author pbs
 */
@Data
public class BaseContext<E> {

    /**
     * RestTemplate引擎
     */
    private HttpEntity<?> restHttpEntity;


    /**
     * 响应结果
     */
    private E restResponse;

    /**
     * ApacheHttpComponents引擎
     */
    private HttpRequestBase apacheRequestBase;

    private String apacheResponse;
    /**
     * Socket
     */
    private String socketRequest;
    private String socketResponse;

    /**
     * before阶段保存实体的UUID
     */
    private String recordId;
    private BigDecimal totalNum;
    private String extendStr;



    /**
     * 请求头校验规则
     *
     * @return
     */
    List<RequestFieldRule<?>> headerElementRules = new ArrayList<>();

    /**
     * 请求体校验规则
     *
     * @return
     */
    List<RequestFieldRule<?>> bodyElementRules = new ArrayList<>();


    /**
     * 请求体扩展字段校验规则
     *
     * @return
     */
    List<RequestFieldRule<?>> bodyExtendElementRules = new ArrayList<>();

}
